package com.bruce.principle.composition;

import lombok.extern.slf4j.Slf4j;

/**
 * Created by bruce on 2018/10/23 23:15
 */
@Slf4j
public class BBBB {

    private AAAA aaaa;

    public BBBB(AAAA aaaa) {
        this.aaaa = aaaa;
    }

    public void print() {
        aaaa.print();
        log.info("bbbbbbbbbbb");
    }

    // BBBB 组合了 AAAA 实现 print() 功能
    public static void main(String[] args) {

        BBBB bbbb = new BBBB(new AAAA());
        bbbb.print();

    }

}
